﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.actions {
    import Classes.*;

    public class ActionPlayAnimation extends NPCAction {

        protected var m_actionTime:Number = 0;
        protected var m_animation:String = null;
        protected var m_originalAnimation:String = "static";

        public function ActionPlayAnimation(_arg1:NPC, _arg2:String, _arg3:Number){
            super(_arg1);
            this.m_animation = _arg2;
            this.m_actionTime = _arg3;
        }
        override public function update(_arg1:Number):void{
            this.m_actionTime = (this.m_actionTime - _arg1);
            if (this.m_actionTime <= 0){
                m_npc.getStateMachine().removeState(this);
            };
        }
        override public function enter():void{
            super.enter();
            this.m_originalAnimation = m_npc.animation;
            m_npc.animation = this.m_animation;
        }
        override public function reenter():void{
            super.reenter();
            this.m_originalAnimation = m_npc.animation;
            m_npc.animation = this.m_animation;
        }
        override public function removed():void{
            m_npc.animation = this.m_originalAnimation;
        }

    }
}//package Classes.actions 
